﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;
using BLL.Student;
using Model.Student;

namespace Web.ExtJs421Demo.Service
{
    /// <summary>
    /// xmlWebService 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消对下行的注释。
    [System.Web.Script.Services.ScriptService]
    public class xmlWebService : System.Web.Services.WebService
    {

        [WebMethod]
        public string HelloWorld()
        {
            return "Hello World";
        }


        [WebMethod]
        public void InsertXml()
        {
            StudentEntity entity = new StudentEntity()
            {
                Id = Guid.NewGuid().ToString(),
                Age = 23,
                ClassId = "11",
                Name = "小李",
                Sex = "男",
                Remark = "无"
            };
            BLStudent bll = new BLStudent();
            bll.Insert(entity);
        }

        [WebMethod]
        public void SelectXml(string Id)
        {
            if (Id.Trim() != "")
            {
                BLStudent bll = new BLStudent();
                var entity = bll.GetInfo(Id); 
            }
            var bb = "";
        }
    }
}
